//
//  MRHotel_TableViewCell.m
//  Travel_World
//
//  Created by dllo on 15/10/20.
//  Copyright © 2015年 TLS. All rights reserved.
//

#import "MRHotel_TableViewCell.h"

@implementation MRHotel_TableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createCell];
        
    }
    return self;
}

- (void)createCell
{
    
    self.ImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.ImageView];
    
    // 标题
    self.title = [[UILabel alloc] init];
//    self.title.textColor = [UIColor grayColor];
//    self.title.numberOfLines = 2;
    self.title.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.title];
    
    // 副标题
    self.enTitle = [[UILabel alloc] init];
    self.enTitle.font = [UIFont systemFontOfSize:13];
    self.enTitle.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.enTitle];
    
    // 评分
    self.point = [[UILabel alloc] init];
    self.point.font = [UIFont systemFontOfSize:13];
    self.point.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.point];
    
    // 星级
    self.star = [[UILabel alloc] init];
    self.star.textColor = [UIColor redColor];
    self.star.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.star];
    
    // 地点
    self.local = [[UILabel alloc] init];
    self.local.textColor = [UIColor lightGrayColor];
    self.local.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.local];
    
    // 价格
    self.price = [[UILabel alloc] init];
    self.price.textColor = [UIColor redColor];
    self.price.font = [UIFont systemFontOfSize:15];
    self.price.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.price];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.ImageView.frame = CGRectMake(20 * WID, 10 * HEI, 110 * WID, 80 * HEI);
    
    self.title.frame = CGRectMake(140 * WID, 10 * HEI, 170 * WID, 20 * HEI);
    
    self.enTitle.frame = CGRectMake(140 * WID, 35 * HEI, 170 * WID, 20 * HEI);
    
    self.point.frame = CGRectMake(320 * WID, 10 * HEI, 40 * WID, 20 * HEI);
    
    self.star.frame = CGRectMake(140 * WID, 60 * HEI, 70 * WID, 15 * HEI);
    
    self.local.frame = CGRectMake(140 * WID, 80 * HEI, 100 * WID, 15 * HEI);
    
    self.price.frame = CGRectMake(250 * WID , 65 * HEI, 100 * WID, 20 * HEI);
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
